﻿<phone:PhoneApplicationPage
    x:Class="animexx.ENSFolderView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    d:DataContext="{d:DesignData SampleData/ENSFolderViewModelSampleData.xaml}"
    shell:SystemTray.IsVisible="True">

    <phone:PhoneApplicationPage.Resources>
        <DataTemplate x:Key="EmailItemTemplate">
            <StackPanel Margin="0,-14,0,24" Tap="StackPanel_Tap">
                <TextBlock Text="{Binding von.username}"
                           Margin="0,0,0,-4"
                           FontSize="{StaticResource PhoneFontSizeExtraLarge}" 
                           FontFamily="{StaticResource PhoneFontFamilySemiLight}"/>
                <TextBlock Text="{Binding betreff}"
                           Margin="0,0,0,-4"
                           Foreground="White"
                           FontSize="{StaticResource PhoneFontSizeNormal}" 
                           FontFamily="{StaticResource PhoneFontFamilySemiBold}"/>
                <TextBlock Text="{Binding datum_utc}"
                           Foreground="{StaticResource PhoneSubtleBrush}"
                           FontSize="{StaticResource PhoneFontSizeNormal}"/>
            </StackPanel>
        </DataTemplate>
    </phone:PhoneApplicationPage.Resources>

    <!--LayoutRoot ist das Stammraster, in dem alle anderen Seiteninhalte platziert werden-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel enthält den Namen der Anwendung und den Seitentitel-->
        <StackPanel Grid.Row="0" Margin="12,17,0,0">
            <TextBlock Text="{Binding Path=LocalizedResources.ApplicationTitle,
                                      Source={StaticResource LocalizedStrings}}"
                       Style="{StaticResource PhoneTextNormalStyle}"/>
        </StackPanel>

        <!--Pivotsteuerelement-->
        <phone:Pivot Title="{Binding OrdnerData.name}" Grid.Row="2">
            <!--Pivotelement eins-->
            <phone:PivotItem Header="{Binding Path=LocalizedResources.ENSFolderAllTitle,
                                      Source={StaticResource LocalizedStrings}}">
                <toolkit:LongListMultiSelector
                    x:Name="ENSFolderAllList"
                    ItemsSource="{Binding Content}"
                    LayoutMode="List"
                    ItemTemplate="{StaticResource EmailItemTemplate}"
                    SelectionChanged="ENSFolderAllList_SelectionChanged"
                    />
            </phone:PivotItem>

            <!--Pivotelement zwei-->
            <phone:PivotItem Header="{Binding Path=LocalizedResources.ENSFolderUnreadTitle,
                                      Source={StaticResource LocalizedStrings}}">
                <Grid/>
            </phone:PivotItem>

            <!--Pivotelement zwei-->
            <phone:PivotItem Header="{Binding Path=LocalizedResources.ENSFolderSystemTitle,
                                      Source={StaticResource LocalizedStrings}}">
                <Grid/>
            </phone:PivotItem>
        </phone:Pivot>
    </Grid>

</phone:PhoneApplicationPage>